package com.An.service.impl;

import com.An.dao.AdminDao;
import com.An.pojo.*;
import com.An.service.AdminService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auther AnYang
 * @date 2022/3/22 20:04
 **/
@Service
public class AdminServiceImpl implements AdminService {
	@Autowired
	private AdminDao adminDao;

	@Override
	public Student getStudentBySno(Integer sno) {
		return adminDao.getStudentBySno(sno);
	}

	@Override
	public StudentDorm getStuDormBySno(Integer sno) {
		return adminDao.getStuDormBySno(sno);
	}

	@Override
	public StudentDorm getStuByDormAndBedId(Integer dorm_id, Integer bed_id) {
		return adminDao.getStuByDormAndBedId(dorm_id, bed_id);
	}

	@Override
	public StudentApplication getStuApplicationBySno(Integer sno) {
		return adminDao.getStuApplicationBySno(sno);
	}

	@Override
	public List<StudentDorm> getStudentDorm() {
		return adminDao.getStudentDorm();
	}

	@Override
	public List<StudentDorm> getQuitStuDorm() {
		return adminDao.getQuitStuDorm();
	}

	@Override
	public List<StudentApplication> getStudentApplication() {
		return adminDao.getStudentApplication();
	}

	@Override
	public List<StudentApplication> getStuApplyUpDorm() {
		return adminDao.getStuApplyUpDorm();
	}

	@Override
	public Boolean insertStudent(Student student) {
		return adminDao.insertStudent(student) > 0;
	}

	@Override
	public Boolean insertStudentSimply(Student student) {
		return adminDao.insertStudent(student) > 0;
	}

	@Override
	public Boolean insertClassTeacher(ClassTeacher classTeacher) {
		return adminDao.insertClassTeacher(classTeacher) > 0;
	}

	@Override
	public Boolean deleteStudentBySno(Integer sno) {
		return adminDao.deleteStudentBySno(sno) > 0;
	}

	@Override
	public Boolean deleteClassTeacher(Integer classid, Integer tid, String subject) {
		return adminDao.deleteClassTeacher(classid, tid, subject) > 0;
	}

	@Override
	public Boolean deleteStuDormBySno(Integer sno) {
		return adminDao.deleteStuDormBySno(sno) > 0;
	}

	@Override
	public Boolean deleteStuApplyBySno(Integer sno) {
		return adminDao.deleteStuApplyBySno(sno) > 0;
	}

	@Override
	public Boolean deleteStuApplication(Integer sno) {
		return adminDao.deleteStuApplication(sno) > 0;
	}

	@Override
	public Boolean updateStudentBySno(Student student, Integer id) {
		return adminDao.updateStudentBySno(student, id) > 0;
	}

	@Override
	public Boolean updateTeacher(Teacher teacher, Integer id) {
		return adminDao.updateTeacher(teacher, id) > 0;
	}

	@Override
	public Boolean updateTeacherByStatus(Integer tid, Integer status) {
		return adminDao.updateTeacherByStatus(tid, status) > 0;
	}

	@Override
	public Boolean updateStuDorm(StudentDorm studentDorm, Integer id) {
		return adminDao.updateStuDorm(studentDorm, id) > 0;
	}

	@Override
	public Boolean updateClassTeacher(ClassTeacher classTeacher, Integer tid, Integer classid) {
		return adminDao.updateClassTeacher(classTeacher, tid, classid) > 0;
	}

	@Override
	public Boolean updateClassGuardian(Integer classid, String guardian) {
		return adminDao.updateClassGuardian(classid, guardian) > 0;
	}

	@Override
	public List<ClassInfo> getClassInfo() {
		return adminDao.getClassInfo();
	}

	@Override
	public List<StudentClass> getStudentByClassId(Integer classid) {
		return adminDao.getStudentByClassId(classid);
	}

	@Override
	public List<StudentDorm> getStudentByDormIdIsNull() {
		return adminDao.getStudentByDormIdIsNull();
	}

	@Override
	public List<StudentDorm> getStudentDormById(Integer dorm_id) {
		return adminDao.getStudentDormById(dorm_id);
	}

	@Override
	public ClassInfo getClassByName(String class_name) {
		return adminDao.getClassByName(class_name);
	}

	@Override
	public ClassInfo getClassById(Integer classid) {
		return adminDao.getClassById(classid);
	}

	@Override
	public List<Teacher> getTeacherListByClassId(Integer classid) {
		return adminDao.getTeacherListByClassId(classid);
	}

	@Override
	public List<Teacher> getTeacherByClass(String class_name) {
		return adminDao.getTeacherByClass(class_name);
	}

	@Override
	public List<Student> getStudentByClassName(String class_name) {
		return adminDao.getStudentByClassName(class_name);
	}

	@Override
	public List<ClassTeacher> getTeacherByClassId(Integer classid) {
		return adminDao.getTeacherByClassId(classid);
	}

	@Override
	public List<ClassTeacher> getAllClassTeacher() {
		return adminDao.getAllClassTeacher();
	}

	@Override
	public List<ClassTeacher> getClassTeacherByClass(Integer classid) {
		return adminDao.getClassTeacherByClass(classid);
	}

	@Override
	public ClassTeacher getClassTeacherByClassSubject(String className, String subject) {
		return adminDao.getClassTeacherByClassSubject(className, subject);
	}

	@Override
	public ClassTeacher getClassTeacherById(Integer tid, Integer classid, String subject) {
		return adminDao.getClassTeacherById(tid, classid, subject);
	}

	@Override
	public List<Teacher> getAllTeacher() {
		return adminDao.getAllTeacher();
	}

	@Override
	public Boolean insertTeacher(Teacher teacher) {
		return adminDao.insertTeacher(teacher) > 0;
	}

	@Override
	public Boolean deleteTeacher(Integer tid) {
		return adminDao.deleteTeacher(tid) > 0;
	}

	@Override
	public Teacher getTeacherByClassSubject(String className, String subject) {
		return adminDao.getTeacherByClassSubject(className, subject);
	}

	@Override
	public Teacher getTeacherById(Integer tid) {
		return adminDao.getTeacherById(tid);
	}

	@Override
	public Page<StudentClass> getPage(int currentPage, int pageSize) {
		Page page = new Page(currentPage, pageSize);
		return adminDao.selectPage(page, null);

	}

	@Override
	public List<Course> getAllCourse() {
		return adminDao.getAllCourse();
	}

	@Override
	public Course getCourseByName(String cname) {
		return adminDao.getCourseByName(cname);
	}

	@Override
	public Course getCourseById(Integer cid) {
		return adminDao.getCourseById(cid);
	}

	@Override
	public CourseArrange getCourseArrangeByClassSubject(Integer classid, String subject, Integer day_id) {
		return adminDao.getCourseArrangeByClassSubject(classid, subject, day_id);
	}

	@Override
	public Boolean updateCourseArrange(Integer sign, Integer id) {
		return adminDao.updateCourseArrange(sign, id) > 0;
	}

	@Override
	public List<Dormitory> getAllDorm() {
		return adminDao.getAllDorm();
	}

	@Override
	public List<Dormitory> getDormByGender(String dorm_gender) {
		return adminDao.getDormByGender(dorm_gender);
	}

	@Override
	public List<Week> getWeeKList() {
		return adminDao.getWeeKList();
	}

	@Override
	public List<Lesson> getLessonList() {
		return adminDao.getLessonList();
	}

	@Override
	public List<CourseArrange> getListCourseArrangeByClass(Integer classid, Integer day_id) {
		return adminDao.getListCourseArrangeByClass(classid, day_id);
	}

	@Override
	public List<ClassCourse> getClassCourseByClass(Integer classid, Integer day_id) {
		return adminDao.getClassCourseByClass(classid, day_id);
	}

	@Override
	public List<Exam> getExamList() {
		return adminDao.getExamList();
	}

	@Override
	public List<ExamDuration> getExamDurationList() {
		return adminDao.getExamDurationList();
	}

	@Override
	public List<ExamSubject> getExamSubjectByExamId(Integer exam_id) {
		return adminDao.getExamSubjectByExamId(exam_id);
	}

	@Override
	public Exam getExamById(Integer exam_id) {
		return adminDao.getExamById(exam_id);
	}

	@Override
	public ExamInfo getExamInfoById(Integer exam_id, Integer exam_cid, String exam_place) {
		return adminDao.getExamInfoById(exam_id, exam_cid, exam_place);
	}

	@Override
	public ExamInfo getExamInfo(Integer id) {
		return adminDao.getExamInfo(id);
	}

	@Override
	public ExamSubject getExamSubject(Integer exam_id, Integer exam_cid) {
		return adminDao.getExamSubject(exam_id, exam_cid);
	}

	@Override
	public StudentExam getStuExamInfo(Integer exam_id, Integer exam_cid, Integer sno) {
		return adminDao.getStuExamInfo(exam_id, exam_cid, sno);
	}

	@Override
	public List<ExamInfo> getExamInfoList(Integer exam_id, Integer exam_cid) {
		return adminDao.getExamInfoList(exam_id, exam_cid);
	}

	@Override
	public List<StudentExam> getExamInfoByClass(Integer exam_id, Integer exam_cid, Integer classid) {
		return adminDao.getExamInfoByClass(exam_id, exam_cid, classid);
	}

	@Override
	public List<StudentExam> getExamInfoByExamId(Integer exam_id, Integer exam_cid) {
		return adminDao.getExamInfoByExamId(exam_id, exam_cid);
	}

	@Override
	public List<StudentExam> getStuExamSelf(Integer exam_id, Integer sno) {
		return adminDao.getStuExamSelf(exam_id, sno);
	}

	@Override
	public List<ExamInfo> getExamInfoListById(Integer exam_id) {
		return adminDao.getExamInfoListById(exam_id);
	}

	@Override
	public Boolean updateStuGrade(Integer exam_id, Integer exam_cid, Integer sno, Integer grade) {
		return adminDao.updateStuGrade(exam_id, exam_cid, sno, grade) > 0;
	}

	@Override
	public Boolean updateClearStuExamPlace(Integer exam_cid) {
		return adminDao.updateClearStuExamPlace(exam_cid) > 0;
	}

	@Override
	public Boolean updateExamInfo(Integer exam_id, Integer cid, String exam_date, String exam_time) {
		return adminDao.updateExamInfo(exam_id, cid, exam_date, exam_time) > 0;
	}

	@Override
	public Boolean updateStuExam(Integer exam_id, Integer cid, String exam_date, String exam_time) {
		return adminDao.updateStuExam(exam_id, cid, exam_date, exam_time) > 0;
	}

	@Override
	public Boolean updateStuExamPlace(Integer exam_id, Integer sno, String exam_place, Integer seat_num) {
		return adminDao.updateStuExamPlace(exam_id, sno, exam_place, seat_num) > 0;
	}

	@Override
	public Boolean updateExamTeacher(Integer id, Integer tid_first, Integer tid_second, String tname_first, String tname_second) {
		return adminDao.updateExamTeacher(id, tid_first, tid_second, tname_first, tname_second) > 0;
	}

	@Override
	public Week queryDateById(Integer day_id) {
		return adminDao.queryDateById(day_id);
	}

	@Override
	public ClassCourse getClassCourseById(Integer classid, Integer day_id, Integer lesson_id) {
		return adminDao.getClassCourseById(classid, day_id, lesson_id);
	}

	@Override
	public ClassCourse getClassCourseByTid(Integer tid, Integer day_id, Integer lesson_id) {
		return adminDao.getClassCourseByTid(tid, day_id, lesson_id);
	}

	@Override
	public Boolean updateClassCourse(ClassCourse classCourse, Integer classid, Integer day_id, Integer lesson_id) {
		return adminDao.updateClassCourse(classCourse, classid, day_id, lesson_id) > 0;
	}

	@Override
	public Dormitory getDormById(Integer dorm_id) {
		return adminDao.getDormById(dorm_id);
	}
}